Skip to main content

slashstarstarslash

Type

keyword

Summary

Delimits a block comment.

Syntax

/**/

Description

Anything between /* and */ is treated as a comment and is ignored by LiveCode when executing the handler.

Comments are useful for documenting and explaining your code, either for others who might need to read and modify it, or for yourself. (The code may be clear in your mind now, but in six months, you'll be glad you included comments.)

The block comments created by /**/ differ from the line comments created by -- because a block comment can span multiple lines, as well as a single line or part of a line. (A comment marked by -- extends only to the end of the line.) A comment that starts with /* does not end until */, even if there are several lines in between.

Comments can be placed anywhere in a script--inside handlers or outside all handlers. In a long script with many handlers, it may be useful to divide the handlers into sections. Each section can start with a comment containing the section name and any other useful information. This practice helps you keep long scripts organized. Similarly, a lengthy handler can be made more readable by explanatory comments.

Comments can contain any text, including line(glossary)lines of LiveCode scripting. If the code is within a comment, it's ignored. You can temporarily remove sections of code for debugging by putting those sections inside a comment.

Examples

local whichPrompt
put "Prompt text here." into whichPrompt
answer whichPrompt /* use the prompt that was set earlier */
/* This entire block, although it is two lines
long, is a single comment. */

glossary: line, handler, comment, delimit, block comment, execute, script

keyword: singleline comment, line

Compatibility and Support

Introduced

LiveCode 2.0

OS

mac

windows

linux

ios

android

Platforms

desktop

server

mobile

Thank you for your feedback!

Was this page helpful?